set(RISKCON_VERSION_NUMBER "1.0.0")
# 获取当前时间年月日信息
string(TIMESTAMP CURRENT_TIME %y%m%d%H%M)

#### Set policy CMP0048 to support `VERSION` keyword for `project()`.
cmake_policy(SET CMP0048 NEW)
message(STATUS "Set CMP0048 POLICY")
#### End - Set policy CMP0048

project(RiskconDemo VERSION ${RISKCON_VERSION_NUMBER})

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O2 -std=c11")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  -g -Wall -O2 -std=c++11")

include (cmake/Utilities.cmake)

cmake_minimum_required (VERSION 3.26)

# include directory
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/)
#include_directories (${CMAKE_SOURCE_DIR}/deps/spdlog/include)
include_directories (${CMAKE_SOURCE_DIR}/deps/protobuf/include)
#include_directories (${CMAKE_SOURCE_DIR}/deps/boost/include)


## 所有要编译的源文件和头文件
set(GLOBAL_SOURCES "")

add_subdirectory(src/common)
add_subdirectory(src/main)


find_library(PROTOBUF libprotobuf.so ${CMAKE_SOURCE_DIR}/deps/protobuf/lib NO_DEFAULT_PATH)

#target_link_libraries(common rt)
#target_link_libraries(${PROJECT_NAME} boost_serialization yaml-cpp spdlog pthread)
target_link_libraries(${PROJECT_NAME} ${PROTOBUF} common  c rt pthread)
